package com.walleipt.demo.ioc.conditional;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

public class MyCondition implements Condition {

	public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
		
		Map<String, Object> annotationAttributes = metadata.getAnnotationAttributes("org.springframework.context.annotation.Conditional");
		Iterator<Map.Entry<String,Object>> iterator = annotationAttributes.entrySet().iterator() ;
		while( iterator.hasNext() ) {
			Entry<String, Object> entry = iterator.next();
			System.err.println( entry.getKey()+"|"+entry.getValue().getClass());
		}
		return false;
	}

}
